package lesson13;

public class Exam {

		public static void main(String[] args) {
			
			//task 3
			int x = 5;
			int y = 4;
			System.out.println(xOnPowerY(x, x, y));
		}

		private static int xOnPowerY(int initialX, int result, int y) {
			if(y == 1)
				return result;
			
			int res = 0;
			for(int i = 0; i < initialX; i++)
				res += result;
			return xOnPowerY(initialX, res, --y);
		}
}
